package mall

import (
	"fmt"
	"mall-go-gin/global"
	"mall-go-gin/model/mall"
)

type MallUserTokenService struct{}

func (m *MallUserTokenService) ExistUserToken(token string) (err error, mallUserToken mall.MallUserToken) {
	err = global.GVA_DB.Where("token = ?", token).First(&mallUserToken).Error
	fmt.Println("============ ExistUserToken ==========")
	fmt.Println(mallUserToken)
	fmt.Println(&mallUserToken)
	fmt.Printf("%v", mallUserToken)
	return err, mallUserToken
}

func (m *MallUserTokenService) DeleteMallUserToken(token string) (err error) {
	err = global.GVA_DB.Delete(&[]mall.MallUserToken{}, "token = ?", token).Error
	return err
}
